package com.google.code.jkippt.http;

public interface APIClient {

	/**
	 * Calls the specified end point getting back the result. 
	 * @param endpoint the end point to call.
	 * @return the server response.
	 * @throws ServerErrorException if the server returns back an error.
	 * @throws CommunicationException if something go wrong with the communication.
	 */
	public abstract String get(String endpoint) throws ServerErrorException,
			CommunicationException;

	/**
	 * Posts the specified content to the specified end point.
	 * @param endpoint the end point where to post.
	 * @param content the content to post.
	 * @return the server response.
	 * @throws ServerErrorException if the server returns back an error.
	 * @throws CommunicationException if something go wrong with the communication.
	 */
	public abstract String post(String endpoint, String content)
			throws ServerErrorException, CommunicationException;

	/**
	 * Puts the specified content to the specified end point.
	 * @param endpoint the end point where to put.
	 * @param content the content to put.
	 * @return the server response.
	 * @throws ServerErrorException if the server returns back an error.
	 * @throws CommunicationException if something go wrong with the communication.
	 */
	public abstract String put(String endpoint, String content)
			throws ServerErrorException, CommunicationException;

	/**
	 * Call Delete on the specified end point.
	 * @param endpoint the target end point.
	 * @throws ServerErrorException if the server returns back an error.
	 * @throws CommunicationException if something go wrong with the communication.
	 */
	public abstract void delete(String endpoint) throws ServerErrorException,
			CommunicationException;

}